package com.common.frame.base

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.databinding.ViewDataBinding
import com.chad.library.adapter.base.binder.BaseItemBinder
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder

abstract class BaseBindingItemBinder<T, VB : ViewDataBinding> : BaseItemBinder<T, BaseDataBindingHolder<VB>>() {

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BaseDataBindingHolder<VB> {
        return BaseDataBindingHolder(LayoutInflater.from(parent.context).inflate(getLayoutId(), parent, false))
    }

    abstract fun getLayoutId(): Int

}